home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
By the Book
/
Learn C++ (CodeWarrior)
/
Chap 04.02 - cin
/
cin.cp
< prev
next >
Wrap
Text File
|
1995-10-20
|
430b
|
24 lines
#include <iostream.h>
const short kMaxNameLength = 40;
int main()
{
char name[ kMaxNameLength ];
short myShort;
long myLong;
float myFloat;
cout << "Type in your first name: ";
cin >> name;
cout << "Short, long, float: ";
cin >> myShort >> myLong >> myFloat;
cout << "\nYour name is: " << name;
cout << "\nmyShort: " << myShort;
cout << "\nmyLong: " << myLong;
cout << "\nmyFloat: " << myFloat;
return 0;
}